package com.seanLab.repository;

import com.seanLab.domain.Article;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

/**
 * Created by ailly on 17-9-20.
 */
public interface ArticleRepo extends MongoRepository<Article, String> {
    public Article findByArticleID(String articleID);
    //public List<Article> findByLastName(String lastName);
    public Article findBySource(String source);

    @Query("{'extractImgFlag':{$not:{$exists:true}}}")
    public List<Article> findByExtractImgFlag();

    @Query("{'extractImgFlag':{$not:{$exists:true}}}")
    public List<Article> findTop1000ByExtractImgFlag(Pageable pageable);
}
